package com.example.graduate.mapper;

import com.example.graduate.dto.GetDataRequest;
import com.example.graduate.pojo.Order;
import com.example.graduate.pojo.ShopOrder;
import org.apache.ibatis.annotations.Mapper;

import java.util.Date;
import java.util.List;

@Mapper
public interface OrderMapper {
    /**
     * 根据订单类型获取数据
     * @param dataRequest
     * @return
     */
    List<ShopOrder> getOrder(GetDataRequest dataRequest);

    /**
     * 根据订单号查询订单
     * @param orderId
     * @return
     */
    Order getOrderById(String orderId);

    /**
     * 接收订单，更改订单中的接货者
     * @param orderId
     * @param userId
     * @param orderStatus
     * @return
     */
    int updateOrder(String orderId, String userId, String orderStatus);

    /**
     * 根据接单者和订单状态获取订单
     * @param advisersId
     * @return
     */
    List<ShopOrder> selectOrderByAdvisersId(String advisersId,String orderStatus);

    /**
     * 插入订单
     */
    Long insertOrder(Order order);

    /**
     * 选择历史订单
     */
    List<ShopOrder> selectHistoryOrder(String userId,String orderType);


    /**
     * 选择历史接的订单
     */
    List<ShopOrder> selectHistoryAcceptOrder(String userId);

    /**
     * 获取用户的进行中订单
     * @param userId
     * @param orderType
     * @param orderStatus
     * @return
     */
    List<ShopOrder> selectOrderByUserIdAndOrderTypeAndOrderStatus(String userId,String orderType,List<String> orderStatus);
}
